<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/11/3
  Time: 19:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="${pageContext.request.contextPath}/assets/images/favicon.png" type="image/png">
    <title>秒杀时段列表</title>

    <!-- BEGIN PAGE LEVEL STYLES -->
    <link href="${pageContext.request.contextPath}/assets/plugins/datatables/css/jquery.dataTables.min.css"
          rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/assets/plugins/datatables/css/jquery.dataTables-custom.css"
          rel="stylesheet" type="text/css"/>
    <!-- END PAGE LEVEL STYLES -->
    <link href="${pageContext.request.contextPath}/assets/css/icons.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]-->
    <script src="${pageContext.request.contextPath}/js/html5shiv.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/respond.min.js"></script>
    <!--[endif]-->

    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .el-card__body {
            padding: 20px;
            background-color: white;
            font-size: 14px;
            border: solid 1px rgba(0,0,0,0.2);
        }

        .el-table th {
            white-space: nowrap;
            overflow: hidden;
            user-select: none;
            padding: 12px 0;
            min-width: 0;
            box-sizing: border-box;
            text-overflow: ellipsis;
            vertical-align: middle;
            position: relative;
        }

        .el-table--border th {
            border-right: 1px solid #ebeef5;
        }


        .el-table--border td {
            border-bottom: 1px solid #ebeef5;
        }


        label {
            display: inline-block;
            max-width: 100%;
            margin-bottom: 5px;
            font-weight: 700;
        }

        .table-responsive {
            min-height: .01%;
            overflow-x: auto;
        }


        /*窗口*/
        .window {
            width: 650px;
            padding-top: 20px;
            padding-bottom: 50px;
            border-radius: 2px;
            box-shadow: 0 0 3px grey;
            background-color: #fff;
            position: fixed;
            left: 500px;
            top: 150px;
            display: none;
            z-index: 10;
        }

        /*中间层*/
        .not-active {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            background-color: rgba(0, 0, 0, .5);
            z-index: 5;
        }

        #shade {
            display: none;
        }

        /*关闭弹窗按钮*/
        .window #close-window .btn {
            border: 0;
            outline: none;
            background-color: #fff;
        }

        .window #close-window .btn:hover {
            color: deepskyblue;
        }

        .btn-default:hover {
            color: deepskyblue;
            background-color: rgb(235, 245, 255);
        }

        .table .handle .btn {
            border: 0;
            outline: 0;
            color: deepskyblue;
            background-color: #fff;
        }

        .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn.active.focus {
            outline: none;
            box-shadow: none;
        }

        .pagination > li > button {
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.42857143;
            color: #337ab7;
            text-decoration: none;
            background-color: #fff;
            border: 1px solid #eee;
        }

        .pagination > .disabled > button, .pagination > .disabled > button:focus, .pagination > .disabled > button:hover {
            color: #777;
            cursor: not-allowed;
            background-color: #fff;
            border-color: #eee
        }
    </style>

</head>

<body class="sticky-header">

<!--Start left side Menu-->
<jsp:include page="../inc/left.jsp"/>
<!--End left side menu-->


<!-- main content start-->
<div class="main-content">

    <!-- header section start-->
    <jsp:include page="../inc/header.jsp"/>
    <!-- header section end-->

    <div class="wrapper" style="background-color:rgb(238, 238, 238)">

        <!--Start Page Title-->
        <div class="page-title-box">
            <p class="page-title" style="color: black">秒杀时间段选择</p>
            <ol class="breadcrumb">
                <li>
                    <a href="#">首页</a>
                </li>
                <li>
                    <a href="#">营销</a>
                </li>
                <li class="active">
                    秒杀时段选择
                </li>
            </ol>
            <div class="clearfix"></div>
        </div>

        <div class="el-card__body col-sm-12">
            <i class="fa fa-file-text-o" aria-hidden="true"></i>
            <span style="font-size: 16px;">数据列表</span>
        </div>

        <!--Start row-->
        <div class="row">
            <div class="col-md-12">
                <div class="white-box" style="border: solid 1px rgba(0,0,0,0.2); margin-top: 15px">
                    <br>
                    <div class="table-responsive">
                        <div id="example_wrapper" class="dataTables_wrapper">
                            <table id="example" class="table table-bordered">
                                <thead>
                                <tr>
                                    <th class="text-center">编号</th>
                                    <th class="text-center">秒杀时段名称</th>
                                    <th class="text-center">每日开始时间</th>
                                    <th class="text-center">每日结束时间</th>
                                    <th class="text-center">商品数量</th>
                                    <th class="text-center">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${flashSessions}" var="fs">
                                    <tr>
                                        <td class="text-center">${fs.id}</td>
                                        <td class="text-center">${fs.name}</td>
                                        <td class="text-center">
                                            <fmt:formatDate value="${fs.startTime}" pattern="HH:mm:ss"/>
                                        </td>

                                        <td class="text-center">
                                            <fmt:formatDate value="${fs.endTime}" pattern="HH:mm:ss"/>
                                        </td>
                                        <td class="text-center">${fs.productCount}</td>
                                        <td class="handle text-center">
                                            <a href="${pageContext.request.contextPath}/sell/flashProductRelation/products?flashPromotionId=${flashPromotionId}&flashPromotionSessionId=${fs.id}"
                                               class="btn btn-default">商品列表</a>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--End row-->
    </div>

    <!--Start  Footer -->
    <%@include file="../inc/footer.jsp" %>
    <!--End footer -->

</div>
<!--End main content -->


<!--Begin core plugin -->
<script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/plugins/moment/moment.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.slimscroll.js "></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.nicescroll.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/functions.js"></script>
<!-- End core plugin -->

<!--Begin Page Level Plugin-->
<%--<script src="${pageContext.request.contextPath}/assets/plugins/datatables/js/jquery.dataTables.min.js"></script>--%>
<script src="${pageContext.request.contextPath}/assets/pages/table-data.js"></script>
<!--End Page Level Plugin-->

<script>

    // 时间格式化
    function dateFormat(date) {
        let hours = new Date(date).getHours();
        let minutes = new Date(date).getMinutes();
        let seconds = new Date(date).getSeconds();
        if (hours < 10) {
            hours = '0' + hours;
        }
        if (minutes < 10) {
            minutes = '0' + minutes;
        }
        if (seconds < 10) {
            seconds = '0' + seconds;
        }
        return hours + ":" + minutes + ":" + seconds;
    }

</script>
</body>

</html>


